from django.contrib.gis.db.backends.base.operations import BaseSpatialOperations
from django.contrib.gis.db.backends.utils import SpatialOperator
from django.db.backends.postgresql.operations import DatabaseOperations
from django.db.models import Func
from typing import Any

BILATERAL: str

class PostGISOperator(SpatialOperator):
    geography: Any = ...
    raster: Any = ...
    def __init__(self, geography: bool = ..., raster: bool = ..., **kwargs: Any) -> None: ...
    def as_sql(self, connection: Any, lookup: Any, template_params: Any, *args: Any): ...
    def check_raster(self, lookup: Any, template_params: Any): ...

class ST_Polygon(Func):
    function: str = ...
    def __init__(self, expr: Any) -> None: ...
    def output_field(self): ...

class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
    name: str = ...
    postgis: bool = ...
    geography: bool = ...
    geom_func_prefix: str = ...
    Adapter: Any = ...
    collect: Any = ...
    extent: Any = ...
    extent3d: Any = ...
    length3d: Any = ...
    makeline: Any = ...
    perimeter3d: Any = ...
    unionagg: Any = ...
    gis_operators: Any = ...
    unsupported_functions: Any = ...
    select: str = ...
    select_extent: Any = ...
    def function_names(self): ...
    def spatial_version(self): ...
    def geo_db_type(self, f: Any): ...
    def get_distance(self, f: Any, dist_val: Any, lookup_type: Any): ...
    def get_geom_placeholder(self, f: Any, value: Any, compiler: Any): ...
    def postgis_geos_version(self): ...
    def postgis_lib_version(self): ...
    def postgis_proj_version(self): ...
    def postgis_version(self): ...
    def postgis_full_version(self): ...
    def postgis_version_tuple(self): ...
    def proj_version_tuple(self): ...
    def spatial_aggregate_name(self, agg_name: Any): ...
    def geometry_columns(self): ...
    def spatial_ref_sys(self): ...
    def parse_raster(self, value: Any): ...
    def distance_expr_for_lookup(self, lhs: Any, rhs: Any, **kwargs: Any): ...
    def get_geometry_converter(self, expression: Any): ...
    def get_area_att_for_field(self, field: Any): ...
